﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using DAL;
using Model;
namespace UI.system.page.product
{
    public partial class productadd : BaseAdmin
    {
        public ProductInfo info = new ProductInfo();
        public string categorys = "";
        public List<CategoryInfo> categorylist = new List<CategoryInfo>();
        public List<TagsInfo> tagslist = new List<TagsInfo>();
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = JobRequest.GetRequestInt("id");
            categorylist = CategoryDAL.FindAll(B.MyAdmin.ID);
            categorys = SerializeHelper.ToJson(categorylist);
            tagslist = TagsDAL.FindAll(B.MyAdmin.ID);
            if (id != 0)
            {
                info = ProductDAL.FindOneByID(id);
            }
            else
            {
                info.Sort = CommonDAL.MaxSort("product");
            }
        }
    }
}